package com.gs.spring;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Component;

@Component
public class GreetingBean {

	String message;
	
	
	String greetedBy;
	
	SimpleBean simpleBean;
	
	SimpleBean simpleBean2;
	
	ShoppingCartBean shoppingCartBean;
	
	@PostConstruct
	public void init(){
		System.out.println("Init method called on annotated method.");
		message = "Message has been initialized.";
	}


	public String getMessage() {
		return message;
	}


	public void setMessage(String message) {
		this.message = message;
	}


	public String getGreetedBy() {
		return greetedBy;
	}

	public void setGreetedBy(String greetedBy) {
		this.greetedBy = greetedBy;
	}


	public SimpleBean getSimpleBean() {
		return simpleBean;
	}

	@Autowired	
	public void setSimpleBean(SimpleBean simpleBean) {
		this.simpleBean = simpleBean;
	}


	public SimpleBean getSimpleBean2() {
		return simpleBean2;
	}

	@Autowired
	public void setSimpleBean2(SimpleBean simpleBean2) {
		this.simpleBean2 = simpleBean2;
	}


	public ShoppingCartBean getShoppingCartBean() {
		return shoppingCartBean;
	}

	@Autowired
	public void setShoppingCartBean(ShoppingCartBean shoppingCartBean) {
		System.out.println("Getting injected.."+shoppingCartBean);
		this.shoppingCartBean = shoppingCartBean;
	}
	
	
}
